\subsection{\refactoring{Introduce Indirection}}
This refactoring creates a static method $m'$ in type $B$ that delegates to a method $m$ in type $A$. Implemented in \sourcelink{IntroduceIndirection/IntroduceIndirection.jrag}; see Algorithm~\ref{alg:IntroduceIndirection}.

\begin{algorithm}[p]
\caption{$\refactoring{Introduce Indirection}(m : \type{Method}, B : \type{ClassOrInterface})$}
\label{alg:IntroduceIndirection}
\begin{algorithmic}[1]
\REQUIRE Java
\ENSURE Java $\cup$ locked names, \code{return void}
\medskip
\STATE \assert $B$ is non-library
\STATE $fn \leftarrow \text{fresh method name}$
\STATE $m' \leftarrow \text{copy of $m$ with locked names and empty body}$
\STATE set name of $m'$ to $fn$
\STATE $xs \leftarrow \text{locked accesses to parameters of $m'$}$
\STATE set body of $m'$ to \code{return}\xspace$m$\code{(}$xs$\code{);}
\STATE $\refactoring{Insert Method}(\util{hostType}(m), m')$
\STATE $\refactoring{Make Method Static}(m')$
\STATE $\refactoring{Move Static Method}(m', B)$
\end{algorithmic}
\end{algorithm}
